﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Cryptography;
using System.Text;
using WuYuHotel.Controllers;
using System.Web.Mvc;

namespace WuYuHotel.Tools
{
    public class EncryptTool
    {
        

        public string SHA1_Hash(string old_string)
        {

            SHA1 sha1 = new SHA1CryptoServiceProvider();
            byte[] bytes_old_string = UTF8Encoding.Default.GetBytes(old_string);

            byte[] bytes_new_string = sha1.ComputeHash(bytes_old_string);

            string new_string = BitConverter.ToString(bytes_new_string);

            new_string = new_string.Replace("-", "").ToUpper();

            return new_string.ToLower();

        }


    }
}